using System;
using System.Runtime.Serialization;

namespace lucere.exception
{
	/// <summary>
	/// Thrown when elapsed search time exceeds allowed search time.
	/// </summary>
	[Serializable]
	public class TimeExceededException:Exception
	{
		public TimeExceededException(string message, Exception innerException) : base(message, innerException)
		{
		}

		protected TimeExceededException(SerializationInfo info, StreamingContext context) : base(info, context)
		{
		}

		public TimeExceededException(string message) : base(message)
		{
		}

		/// <summary>
		/// Returns allowed time (milliseconds).
		/// </summary>
		public long TimeAllowed { get; private set; }

		/// <summary>Returns elapsed time (milliseconds).</summary>
		public long TimeElapsed { get; private set; }

		/// <summary>Returns last doc that was collected when the search time exceeded.</summary>
		public int LastDocCollected { get; private set; }

		public TimeExceededException()
		{
		}
	}
}